package homework.clazz.data3.data4;

public class Text1 {
        //求平均值
        public static double calculateAverage(int[] numbers) {
            int sum = 0;
            for (int i=0; i<numbers.length; i++)
                sum += numbers[i];
            return sum/(double)numbers.length;
        }
        //求最大值
        public static int findMaximum(int[] numbers) {
            int max = numbers[0];
            for (int i=0; i<numbers.length; i++)
                if (numbers[i] > max)
                    max = numbers[i];
            return max;
        }
    }
   class CalculatorTester2 {
        public static void main(String args[]) {
            int numbers[] = {23, 54, 88, 98, 23, 54, 7, 72, 35, 22};
            System.out.println("The maximum is " + Text1.findMaximum(numbers));
        }
    }

